﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Forget.HRBLL.Logical;

namespace HRWebSite.Employee
{
    public partial class AuditLeave : BasePage
    {
        protected override void Page_Load(object sender, EventArgs e)
        {
            this.HRLimits = Limits.HolidyAudit;
            this.HRLimitAttribute = Forget.HRBLL.LimitAttribute.Read | Forget.HRBLL.LimitAttribute.Audit;
            base.Page_Load(sender, e);
            Session["Audit_NumberID"] = this.HRUser.NumberID;
        }

        protected string GetState(string state)
        {
            if (state == "0") return "未审核";
            else if (state == "1") return "未通过";
            else if (state == "2") return "通过";
            return "";
        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            string passIDs = this.Request.Params["auditPass"];
            string failIDs = this.Request.Params["auditFail"];
            if (!HolidyInfoLogical.AuditHolidyInfo(this.HRUser.NumberID, passIDs, failIDs))            
                this.Response.Write("<script>alert('审核失败！')</script>");            
            else
                this.GridView1.DataBind();
        }
    }
}